import http from "./http"

function convertParam(param){
    var result="";
    for(var name in param){
        result+=name+"="+param[name]+"&";
    }
    return result;
}
export default {
    jsonParam(param){
        var result="";
        for(var name in param){
            result+=name+"="+param[name]+"&";
        }
        return result;
    },
    test(){
        console.log("test.........")
        http.get('/api/sysMenu/listMenu',{}).then(res=>{
            console.log("++++++++++++相应++++++++++++")
            console.log(res)
        },err=>{});
    },
    loadMenu(){
        return http.get('/sysMenu/listMenu',{});
    },
    login(mobile,pwd){
        return http.get('/login/login?mobile='+mobile+'&pwd='+pwd);
    },
    loadAllMenu(){
        return http.get('/sysMenu/list',{});
    },
    deleteMenu(id){
        return http.get('/sysMenu/delete?id='+id);
    },
    addMenu(param){
        return http.get('/sysMenu/update?'+param);
    },

    loadUser(param){
        return http.get('/sysUser/list?'+param);
    },
    deleteUser(id){
        return http.get('/sysUser/delete?id='+id);
    },

    addUser(param){
        return http.get('/sysUser/update?'+param);
    },
    loadRole(param){
        return http.get('/sysRole/list?'+param);
    },
    loadAllRole(){
        return http.get('/sysRole/listAll');
    },
    deleteRole(id){
        return http.get('/sysRole/delete?id='+id);
    },
    updateRole(param){
        return http.get('/sysRole/update?'+param);
    },

    
}